package com.duowei.diandan.fragment.dialog;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.duowei.diandan.R;
import com.duowei.diandan.constant.NetConfig;
import com.squareup.picasso.Picasso;

public class WeixinRegisterDialogFragment extends BaseDialogFragment {

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_weixin_register_dialog, container, false);

        ImageView qrcodeImageView = view.findViewById(R.id.qrCodeImageView);
        Picasso.with(getContext())
                .load(NetConfig.getWeixinQrcodeUrl())
                .error(R.drawable.ic_broken_image)
                .into(qrcodeImageView);

        view.findViewById(R.id.confirmButton).setOnClickListener(v -> dismiss());

        return view;
    }
}
